#ifndef __PDTABCOBJ_H_
#define __PDTABCOBJ_H_

class PDTAbcObj {
public:
    virtual ~PDTAbcObj() {
    }

    virtual bool isNull() {
        return true;
    }

    typedef enum {
        BoolType,
        NumType,
        NumArrayType,
        BoolArrayType = NumType,

        LastType
    } AbcObjType;

    virtual AbcObjType getType() const = 0;
};

class PDTBoolAbcObj : public PDTAbcObj {
public:
    Abc_Obj_t * pBObj;

    PDTBoolAbcObj(Abc_Obj_t * aObj = NULL) :
        pBObj(aObj) {
    }

    Abc_Obj_t * & operator [] (const unsigned int index) {
        return pBObj;
    }

    virtual bool isNull() {
        return (pBObj == NULL);
    }

    virtual AbcObjType getType() const{
        return BoolType;
    }
};

class PDTNumAbcObj : public PDTAbcObj {
public:
    vector < Abc_Obj_t * > pObjs;

    PDTNumAbcObj() {
    }

    PDTNumAbcObj(vector <Abc_Obj_t*>  inVec) {
        pObjs = inVec;
    }

    PDTNumAbcObj(unsigned int size):
        pObjs(size) {
    }

    Abc_Obj_t * & operator [] (const unsigned int index) {
        return pObjs[index];
    }

    virtual bool isNull() {
        return pObjs.empty();
    }

    virtual AbcObjType getType() const{
        return NumType;
    }

    unsigned int size() const {
        return pObjs.size();
    }

    Abc_Obj_t * & at(const unsigned int index) {
        return (*this)[index];
    }
};

typedef PDTNumAbcObj PDTBoolArrayObj;

class PDTNumArrayObj : public PDTAbcObj {
public:
    vector < PDTNumAbcObj * > pAObjs;

    PDTNumArrayObj() {
    }
    
    PDTNumArrayObj(vector < PDTNumAbcObj * >  inVec) {
        pAObjs = inVec;
    }

    PDTNumArrayObj(unsigned int size):
        pAObjs(size) {
    }

    PDTNumAbcObj * & operator [] (const unsigned int index) {
        return pAObjs[index];
    }

    PDTNumAbcObj * & at(const unsigned int index) {
        return (*this)[index];
    }

    unsigned int size() const {
        return pAObjs.size();
    }

    virtual bool isNull() {
        return pAObjs.empty();
    }

    virtual AbcObjType getType() const{
        return NumArrayType;
    }
};
 
#endif
